﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using 控件调整.Views;

namespace 控件调整
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            LoginWindow loginWindow = new LoginWindow();
            bool? flag = loginWindow.ShowDialog();

            if (flag == null || flag == false)
            {
                Application.Current.Shutdown(0);
            }
        }

        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox? listBox = sender as ListBox;
            string val = ((ContentControl)listBox.SelectedValue).Content.ToString();
            if ("退出系统".Equals(val))
            {
                Application.Current.Shutdown(0);
            }
            else if ("个人信息".Equals(val))
            {
                UserModifyView userView = new UserModifyView();
                userView.ShowDialog();
                return;
            }
            MessageBox.Show(val);
        }
    }
}